Fixing small bug when renaming files, refs #44