fix post aggs with group by in #472

Uses the test case in #592 (with a minor change of using doubles for post aggs instead of longs).