Log Message: add changes from upstream to fix a regression in 0.40 with ssh-agent support, these fixes will be in 0.41 bump revision