More fixes for windows build, and found optimization flag regression in plugins(!)