This, as well as the formatting issues and goto usage, have been taken care of.
Please let me know if there's anything else preventing this pull request from being merged.