Fixes bug with file renaming