Bug fix for pagination when there are no pages.