Fixed clear_tmp to only operate on current env.