Fix lexer index on parse or type error.
Handle undefined values of bool and int.