Fix some issues with the 3 way handshake