Fix pagination's page calculation.