Fix for VS2012 by Doug Turnbull.