Small fixes

Several small fixes, fixing bugs on grouping and getById