Fix tests on windows, fixes #3141