TypeFactory improvements and workaround for groovy build skip (will revisit later).