Fixed bugs in lexer and type checker