Fix a bug that PaginatableArray#total_pages returns the wrong value

closes #416