Fixed java.util.ConcurrentModificationException bug.
Not necessarily the most elegant fix, but it works.