Prevent a ConcurrentModificationException.