Added support for Enum types

Uses the index value to retrieve the proper enum constant.