Fixed issue with multiple objects being serialized