Remove ssh agent stuff and fix history saving