Fixed insecure script errors and options being undefined