Multi-thread fix for VS 2013