fix scan-build issues