Fixes for windows compilation

Fixes for windows compilation, VS2012