fix some warnings about undeclared globals