Fixed COUNT aggregation function