Fixes to set temp directory