Fix test to handle varying key order