Fixed some Windows compatibility issues