Fix the scoping of enums (including C++11 enums)