Fix some script issues