Merge branch 'dict' into v1.0.x
diff --git a/codespell.py b/codespell.py
index cf81490..b9bc803 100755
--- a/codespell.py
+++ b/codespell.py
@@ -178,7 +178,7 @@
 
                 if options.write_changes and misspellings[lword].fix:
                     changed = True
-                    lines[i - 1] = line.replace(word, fixword, 1)
+                    lines[i - 1] = lines[i - 1].replace(word, fixword, 1)
                     continue
 
                 cfilename = "%s%s%s" % (colors.FILE, filename, colors.DISABLE)