Fix bugs in http sync protocol.