fix bugs in install scripts

Change-Id: Ia844376ceec44627acf640fa02870b39536f30bf