Add proper error processing for refused connections.