Various scan-build fixes #2