CRITICAL BUG FIX: Renaming all the files in a directory would cause all but the last one to be deleted by being renamed to the same name. Sorry for that.