Fix warnings and errors detected by clang.