Get rid of a lot of compiler warnings.
Cleanup code