Corrections on lexer loop next implementation