Fixes #9 and a ConcurrentModificationExcpetion.