Fix calls to socket_error