Multiple changes

- Fixed problems with identifier shadowing.
- Moved definitions related to enumerations to the enum namespace.