Make sure the enumerator stops after all items have been enumerated.