Fix for #598.

When totalServerItems is updated, maxPages() wouldn't get evaluated until after the user changed the currentPage input, so maxPages() could be less than currentPage and Angular would change the currentPage to undefined (via it's max parser) which would result in badness.