fix template substitution in lcsimulate