more precdence fixes
make sure DESTROY gets called before tempdir cleanup