Fix global declaration SyntaxWarning

This should be merged by @commixon