Issue #139: Fix count and pagination.