BUG: fix bug related to tmp folder not deleted (issue #51)