Work around a bug in the VC++10 standard library. Hopefully fixes bug 3594; regression tests will tell. This may need to be updated if subsequent releases have the same bug.