Fix model generator