Fix capture on Windows