Improve ScratchDir functionality to allow temp dir in current directory.