Bug fixes

Minor tmp directory bug.