Sort keys to avoid random changes.