Fix clang errors and warnings