fixes for Microsoft VC++ 2012
Merge branch 'vs2012'