If you erase while iterating, remember to update the iterator.  Bug found by Carlo Kok.