Fixed '..Handshake after invoking quit.' error