Fix zero division error when the first page is empty