Tidy up. Fix a bug with directories 2+ levels deep