Fix "util.py:56: No global (temp_dir) found" issue