Fix the factory to save after modifying the module.