Fixes pagination.