Incorporated fixes for windows build