Analysis: various warnings fixed.

Fixes the following CA warnings:

- [CA1305](http://msdn.microsoft.com/en-us/library/ms182190.aspx)
- [CA1725](http://msdn.microsoft.com/en-us/library/ms182251.aspx)
- [CA1702](http://msdn.microsoft.com/en-us/library/bb264474.aspx)
- [CA1720](http://msdn.microsoft.com/en-us/library/bb531486.aspx)
- [CA1719](http://msdn.microsoft.com/en-us/library/ms182252.aspx)
- [CA1711](http://msdn.microsoft.com/en-us/library/ms182247.aspx)
- [CA1721](http://msdn.microsoft.com/en-us/library/ms182253.aspx)
- [CA1012](http://msdn.microsoft.com/en-us/library/ms182126.aspx)