Small bug fixes to model generator template.