Fixes for enumerations
Merge pull request #5899 from wmtan/FixesForEnumerations

Fixes for enumerations