change replacements from % to ${original}, from # to ${counterp} and add a parentheses-less version of the counter as ${counter}