Code cleanup, style consistency, prevents global leaks
Merge pull request #1 from brianegan/master

Code cleanup, style consistency, prevents global leaks