Fix logic of ssh detection.