Fix implicit global
Remove unnecessary variable
Style fixes