Fixed a crash when a peer disconnects