Added lots of template fixes and auto_mkdir module