Use correct key when setting group terms

Fixes #403

props @sjeng