Fix messed up pagination.