Fixes zero length write() to socket