Improvements to nested groups handling