fix clang build error and warnings.