fixed minor script issues