Added support for a custom base class.