Fixed some issues with the parser, more unit tests to verify correct behaviour.