Fixing ConcurrentModificationException.