Fix #2167 on Windows