Sort hash so results are consistently ordered