The subtotal rows were attached to the wrong groups. This change fixes the order of the rows. BUG: 416274 FIXED-IN: 5.0.8 (cherry picked from commit f8ae85c3)