Fix warnings (bugs) found by clang.