Fixed a lot of compiler warnings.