Add ssh check and more cleanup