Fix pagination helper.