fixed a few warnings from clang static analysis