fix clang static analysis warnings