Fixes a socket error.