fixed some problems with parser