fixed some problems with lexical analysis