Fix bug in parser error handling