Fixes from clang scan-build