Added allowances for failed queries in retrieve_schemas