Add support for newDirectInstance()