fix grouping and more fraction bugs