Added some more tests and fixed one critical bug in the protocol parser.