Fix test failures

Fix a few test failures caused by assumptions about non-deterministic things like in what order keys in a dict will be serialized to JSON