fix some bugs in class 'Paginator'