Slight change of diagram generating script.