Fixes #3150 Fixing an error when renaming profiles