preserve autogrouping in subset and flipper
(cherry picked from commit c1fcdb1ddc206fc51808ac57dfe51d93c9b5c9f2)