Fix dos2unix
Add check for temp directory