adjust detection of need onlyCount (fixes #3507)