tmpl: fix tmp cleanup, closes #64