Fixed bug where the current page could exceed the number of pages on a repagination event. If this occurs, the current page is now set to the number of pages.