Add tests for pagination and fix some counter issues