Fixes SSH CLI when using custom "shell" option.

This fixes SSH CLI when using the custom "shell" option.  Also
addresses compatibility issue with PuTTY