fix bug in getting group ids for the user
Merge branch 's-hist' into staging2