compile O1 fix and some 3rdparty windows fixes