Fix an incorrect index check that prevented subgroups to work for groups with shared variables.
Make sure that arrays have unique names in C++ standalone, even if they have the same name and owner (this can happen for example for multiple connect calls with arrays). Fixes #302