Fixes to make it compile with Visual Studio 2010.