Fixed bug in printing: when there were more than 500 prints made, the static hashmap was cleared. But items were removed while iterating, which gave a concurrentmodification exception. Switched to iterator, and removed the items from the iterator (which delegates it to the underlying collection). Fixes #290