Fix directory & tempfile handling.
Welcome 0.3.1.