Fixed result writing error on Windows.