Changes to make it compile on Visual Studio 2013 (finally!)