complete functional test for parser and fix issues encountered