Modified writeOut().