Improve error message for syntax errors