Fix pagination in layout.