Corrects occassional reordering in unnested queries