Improved error reporting for lexer