Add functionality to download individual files. Fix issue with global variable redefine.