Fix some build warnings on protocol.cpp