Fix PEBKAC-class iterator bug