Use pre-increment instead of post-increment for iterators, and use auto for some iterators