Writing more tests/fixing bugs in parser