Fixed a bunch of warnings.  Left some warnings in Visual Studio that are fixed by the mathfix branch.