Using 'replace' instead of 'substring' to strip template names from path...

...s