Fixing and refining queries