Fix a bug that paginatable arrays with total_count option always returns whole array

Fixes #516