Major bug in the get groups function that I can't detect ....