Fixed Minor Problem with groups

Now changing the number of groups works properly.