Tests for grouping consistency routines, plus fixes.