Replaced hardcoded boolean value with correct parameter.

Added test to count API, implemented changes suggested by review.

Closes #3898