Fix some errors in the protocol implementation