FIX: IllegalStateException with many duplicates