Small optimization to count