Added 'connection refused' check.