Fixed bugs in lexer