Clean up directories on failure.  Closes #58.