Remove unneeded global variables

And small comment fixes.
Merge branch 'small_fixes'