Bugfixing parser. Added tests.
Typo.
Reset state on connection closed.