Fixed a lot of clang compiler warnings.