Correctly handle connect cancellation