Fixed bug in test setup: temp directory was deleted after the test had started.