Improve graphtool output code.