small fixes for clang static analyzer

a few small things clang static analyzer found