Some fixes in ssh connection and killing ssh tunnel