[PDT-5578] Fix bug in count without filtering