Backport fix for UT on Windows