Improved parser error handling.