Fixed some write errors.