misc fixes

vs2012 compilation fixes, etc.