Small changes closing sockets