Fixed deletion then iteration, added test