Bugfix: use new aggregation functions