Fix StructureIterator removing issue and add UnitTest for it.