Modified dangling iterators and loop index.