Fix some script errors