Fix bug "incorrect max page displayed when data is filtered".