Bug correction: calling doscript() as a local function.