Fix download file error handling.