Fix minor bugs with multiple SSH sessions.
Fix minor bugs with multiple SSH sessions.