More guards against closed sockets