Fix up SSH functions.
Miscellaneous fixes.