Fix bugs with scp upload