Fixed and improved new Enum-related code.