Fixed build on visual studio 2012.

Note that the latest patch from november 2012 is still needed.