Script improvements

Change-Id: Ibf1858ae4ab3d45afe1c89fd030a1070c0bd1cd1