Fix CR
Add workaround for WIN32 threads