Fix issue with ordering of keys