Fixed a weird undeterministic sorting of dictionary keys bug