Fix for the ssh.py that was getting stuck under certain cases