Multiple fixes for windows build system problems