Fix SAM after unserialize