More small tweaks for serializing/unserializing