Fix an exception caused by range header in downloads