Fix bug when renaming data