Fix write percentage calculation error.