Fix memory corruption when a page has no text