to_entries should not sort keys (fix #561)