Improve handling of temp_dir and _reader files.