Another fix for templates, using temporary directory instead of a custom file loader.