Analysis: more warnings fixed

Fixes the following CA warnings:

- [CA1024](http://msdn.microsoft.com/en-us/library/ms182181.aspx)
- [CA1045](http://msdn.microsoft.com/en-us/library/ms182146.aspx)
- [CA1051](http://msdn.microsoft.com/en-us/library/ms182141.aspx)
- [CA1304](http://msdn.microsoft.com/en-us/library/ms182189.aspx)
- [CA1305](http://msdn.microsoft.com/en-us/library/ms182190.aspx)
- [CA1307](http://msdn.microsoft.com/en-us/library/bb386080.aspx)
- [CA1500](http://msdn.microsoft.com/en-us/library/ms182216.aspx)
- [CA1801](http://msdn.microsoft.com/en-us/library/ms182268.aspx)
- [CA1804](http://msdn.microsoft.com/en-us/library/ms182278.aspx)
- [CA1806](http://msdn.microsoft.com/en-us/library/ms182273.aspx)