Prevents an exception from raising in some corner cases where SSH might be misconfigured. It seems not to fix a specific problem, although it makes the method a little bit more solid.