Fixed handling of dollar signs in values in multiple-instance templates

Change-Id: I5a40240eac40da82db22a901b28937d1ec15cc36