Fix count aggregate API