Add serialization fix from main repository