Windows fixes

Fixed of windows build + one windows crash