Fix unbound variables in cartridge scripts