Serialization of basetypes