Setting template engine only if mandatory to not break templateDir confi...

...g