Fix result count/pagination.

Fixes #89.