fix tooltip off-by-one page number
fix compiler warning in case statement