Added support for DISTINCT aggregates.