Some minor improvements of handshaking when resending the same protocol