fixed stuff that clang analyzer found