Minor fixes in ordering