Some fixes to the protocol