Fix some script issues
Merge from Perforce