Fixed query elaboration problem