Fixed the way of opening files in the downloader