Added fix for template_dir