Fixing script erros