Revert "revert "improve document count accuracy""

This reverts commit e21c79eb3eacf7c74f0a9080876cbdda7c1f8ac7.
damnit travis