correct small issues identified by scan-build

all small stuff