Update iterator position when deleting elements