Fixed bug where indexed metadata couldn't be added to an element if the element already existed and was not an array.