Fixed warnings reported by scan-build.