Avoid global variable leak in script files