Fix for directory rename moving directories.
Added auto-restore flag / function