Fix query test script