CBIDXT-310: bugfixes to Count() index.

Change-Id: Id4c2386f61ad28c9f3e6f556261a2c885fa68926