Fixes for VC++/Windows