Improved enum handling for JSONMarshallable.