Fixing the writing index.