Fixed a problem for multi-schema compilation when different model classes might have different object factories.