Fixed remaining bugs in SSH scripts