Fix clang static analyzer warnings