Fixed a bug that made it rename the wrong files