It was missing these steps. The G_SCRIPT undefined error was invisible because `err` wasn't checked. I'll add a check while I'm in here.