Fix build errors, clang warnings.