Fix various windows build issues