Avoid ConcurrentModificationException in fixReference()