fixes subtle lexer bug with streams and EOF