Fixed hang on Windows