Moved global variable to globals infrastructure.
Resolved global variable, more consistent formatting.