Now deals with nested subdirectories correctly
Removed obsolete clear_remote() fragment