Disc number into Directory

Somewhere deep in the archives I found that it is absolutely advisable to rename a folder always in a separate action group.
The problem I see: you rename the file and the folder in the same action group.
So depending on the internal order of execution, where file system operations are somewhat special, it could be that the renaming of the file and / or the folder leads to the duplication.
Try to rename files and folders in separate actions (and leave out the $replace() if you have already replaced the whole stuff in the original fields).