[nits] small changes to fix clang analyzer errors