Tidied test_groupings.
Tests for grouping consistency routines, plus fixes.