Fixed a typo introduced in a clean-up.

In change 17525f39bc201c64ba836c0b5199e77f9140ecaf a loop variable
was changed from 'group' to 'g' but the variable in the body of the
loop was not updated.