Move a bit of error handling back to parser.