Fix error handling with rename and new file/folder