Bug fixes to the protocol