fixes due to clang static analyzer