fix bugs in lexers and and test script