More robust error handling in batch download.