Failed download handling

Merge failed-download-handling by Tolstyak