Enhanced to download always when "overwrite" is true.