Use number of items to iterate through result list.

From #6359.