Fix for sub-groups + tests for arrays