Fixing script issues