Take care of arguments that are used multiple time in a templated string

[Finishes github issue #11]