Corrected query test