The issue with `n = rpc->scan(c, "S*S", &group, &var);` was due to a bug in `ctl` module, using `kamcmd` revealed that. Using `kamctl` with `jsonrpcs` module was not affected. The bug is fixed now in master and it will be backported.
Besides using the `*` specifier for optional params, your patch in this PR was adjusted so that the `cfg.get` for a group returns a structure with field names and values. All are in master now.