First part of some build fixes for windows