Use iterator when removing to avoid ConcurrentModificationException -
fixes #652