Fixed temp file bug that lead to empty data in archive.