Handle another removal case missed in prev commit.

Also, the loops which only remove a single element and break or return
don't need the extra logic for iteration since they don't continue
iteration after removal.