Fix compiler errors and warnings

When I pulled down your project I found a bunch of compiler errors and warnings.  This should fix most of them.