.write bug fix, and occasional line parser issue