Fix crash when we have no pages