Fixed clean-up so files aren't left in /tmp