CORE-4926: remove a trailing period, if present, from the template name when determining the output file name