Fixed bug in multi-core Windows environment