tmpl: fix tmp cleanup