Improved parser and parser test