Made cleanup work when tmpdir does not exist.