fix object query building, add groupby to selects in verse