backport #2720, correct save/remove behiour of enum indexes
Merge pull request #2731 from eminn/fix/RemoveEnumIndex-backport

[backport]  correct save/remove behiour of enum indexes