Fix paginate bug for failing integration test