Fixed a bug when trying to fetch the number of results.