fix crashes w/ 0 pages