Improved the way the object and array type add new elements