fix some scan-build warnings