Checking for other errors first in Query.Scan