Tmp folder and history

Corrections for history
Changed the tmp folder for templates