Fix build update script bugs

Change-Id: I514a1538393fecb07d779333706aceda9a3eba33