Tempdir fixes

partial application of #63