Fixes tmpdir cleaning