Some corrections to previous script from sniff. (cherry picked from commit 769b7ff7fd2cb86f5b9978d15ea20c398273ec48)
hotfixes