Fix Magic problem on Windows