Fix template creation.