Fix #10 -- clean up temp on failure