While looking for a tool to find big methods, I ended up running cppcheck on the code and found a few errors. These are fixes for some of the more obvious errors.
Merge pull request #51 from masecknotrealname/static_analysis

While looking for a tool to find big methods, I ended up running cppchec...