Fix and test upload util.