Re-do some recent iterator-related changes that may have been clobbered in a merge. Fix an apparent typo bug in buildClusters() that would pass output as both input and output?