fixed a bug with the named parameters

- it could happen that the replacement code was executed if values is an empty array