Fix issue with pagination and update tests.