few fixes in ordering