Fix some issues found by the Visual Studio 2012 static analyzer.
Fix some minor warnings which have no effect on code produced
Merge commit '5372e08aba0d72dec4cf9fbca0f3723bba0914a8'

* commit '5372e08aba0d72dec4cf9fbca0f3723bba0914a8':
  Fix some minor warnings which have no effect on code produced
  Fix some issues found by the Visual Studio 2012 static analyzer.