Fix fetchEmptyQuery bug