Fixed query execution