Fix some formatting issues pointed out by various tools
Remove useless "global"
Update TODO comment