Fix protocol version, rewrite handshake tests.