Implemented download retries. Fixes issue #39