Fix getQueryResultFromId() when not found