Fix white spaces
Added configurable TmpDir to avoid race conditions