Fix accidental global variables