[WIP] Fixed filesystem issue on windows

Fixes #2304 Can you please test it?