Changes to allow compilation on Windows with Visual Studio 2012