Fix pagination issues