Moved appropriate code from get_agg_expr to get_ordset_expr in ruleutils.c