Changed some methods for using tarfile.