fix mistakes in iter_remove()