Code Maintenance

Fixing broken build in tests and addressing numerous warnings.  I have not tested the test code that was not compiling earlier but I believe I have corrected the logic of the test.  In the future we should probably try compiling the tests before a release and maybe run them?