Fix wrong max page number