Propagated previous fix to the count query