Fixed some Windows bugs