Fix handshaking, closes #53