Aggregate function fix.