Revert "Revert "improve document count accuracy""

This reverts commit a6a5f3296338eed6cf2c366b8de2aeff5a4d4bb1.
damnit travis