Fixed handling client disconnects.