Fixed minor bug in page number generation