Update upload script to be more reliable.