Fixed some Windows build issues, probably broken for Linux now. Considering dropping Windows support