Added unittest for count aggregation, fixed this aggregation