fix caching of template paths, closes #1634