Fixed clang static analyzer issues