override ENV['TMP']
fixed directory ownership/group
add debug
fixed tempfile directories
code cleanup
code cleanup