Fixed some static code analysis warnings

As far as I can tell, the items commented out are unused, and I like to have a clean compile and analysis. Thanks for sharing Dimitri. BP