Use return_gateway_groups_array() to build correct GWG list

Version for 2.1 branch