Fixed some problems with closing sessions and waiting for handshakes
6 files changed