small clang fixes

a few small fixes from clang static analyzer