Fixed bugs in script

Change-Id: I994688c72ef8e01b85c6c5022f660d210f3da920
Merge "Fixed bugs in script" into develop