Added testing for parser and fixed bugs.