Fixing bug with inter-script references and globals.