add check for emptiness of QueryIndexList, fix typos and error messages