Fixed a potential issue with downloading files