Fix grouping when there is more than 1 item to group