Fixed calls to Socket.shutdown