Add SSH config, remove superfluous function, handle directories better.