[patch libteam 0/3] fix couple of issues uncovered by covscan