Applied #76 to all templates.
Adding setdlldirectory call fixing #75