Fix paging offset calculation