Improve unit test for mg_download