Bugfix with iterators cleanup