Fix scan-build warnings