Fixed invalid iterators