Code Cleanup

_More commits to come..._

I've cleaned up a bunch of code analysis warnings.

There are still about 500 more, especially about case sensitivity in string comparisons.