Added support for custom types