Fix downloading from redirected URLs