Fixed segfault when printing more than one page