windows build improvements and fixes