Fix bug in --save caused by failure to initialise ctx.error to zero