Fix segfault when bookmark is past the end of pages