Fixed a diagram save bug