[Prd-4216] Total page count function produces incorrect results.

[Prd-4216] Total page count function produces incorrect results.

@tmorgner