Fix file rewriting.