Fix incorrect serialization state after loading

Fixes #13861