Corrent issue in random selection of entities from groups being off by one