Fix the queryStatus call so that a 0 is generated on a query error