Fix regression in fadc4b3d; total_count is not the same as total_pages

Fixes #958. This is the expedient thing to revert, but maybe there's a better approach. @jcoyne?