Fixed a bug when renaming files at the actual dir.