Windows compatibility fixes