Fix unintended global variable declarations