Correctly handle collected errors

We also only want to increment the error counter once for each lookup