misc fixes

Issue(s) found via [cppcheck](http://cppcheck.sourceforge.net/).