Fix infinite loop if count and limit is 0

* otherwise it will always think it hits the limit and need another round to fetch additional results