Fix globals when declared in last statement of __init__