add spec and fix for assigning via [] a hash to a metadata