fixed some iterators and made generated code compile again