Enabled Code Analysis with unmanaged recommended rules and fixed the warnings.