Fixes for windows, VS 2012

Fixes for windows, VS 2012