Fix the problem about PROGDIR & add TMPDIR.