More work on protocol and parser.