Fixed bug with deleting while iterating.