Fixed deserialization error caused by SWIG not setting the object ownership flag (see bug 1902)