Fix crash when renaming categories twice.