Fixed download_and_unarchive function along with other modifications