Made adding of objects more robust
p4#: 21009