My guess is that the post count also includes deleted posts. Thats why sometimes the page count is off. Clicking 'last' should take you to the last valid page though, i have observed.