Fix the offset based paging code