Merge changes after removing the counter and iterator hierarchy, test fixes.