Fixed a bug in how %replace is handled when 'target' is specified to avoid multiple attribute values instead of replacing the attribute value.