Fix a bug when renaming the same object multiple times