Fixed issue with automatic factory.