Added support for proper group assignment during setup.