fixes for some script errors