Added support for enums, nullable primitives, and custom type mapping.