Back port to VS2010.