added some tests for the parser and fixed some bugs