Avoid UB on load/save state keys.