minor itertools related fixes