Fixed a bug in SerializationContext.Serialize.