Fix some warnings with clang static analyzer