Fix processing of errors during parsing