Some bug fix for the script

Change-Id: Ia2249c7b1349438cc2159271634444b1d7b95228
Merge branch 'master' of https://github.com/couchbase/build