Fix bug in downloading files.