fixes for groupby