Fix duplicate content caused by $groups_template global confusion