An attempt to resolve inconsistent return-type of Count method (Issue #3368)
Corresponding change in test_core