Some scan-build fixes