Add "metadata" to aggregate functions