sequence fixes to lexer and parser