some fixes for win32 weirdness.