Export a nameless histo to Root macro (*.C) does not work

Hello, I plot a 2D figure. If I try to export this figure to ROOT macro format, I get a *.C file which does not work. I joined original figure and the corresponding ROOT macro. If I run this macro, I got this message

[quote].x hff_Brho_theta_Cm.C
Error: Function >SetBinContent(3296,1) is not defined in current scope hff_Brho_theta_Cm.C:13:
*** Interpreter error recovered ***[/quote]
Indeed, file seems to be wrong. I use ROOT 5.30/02. I do not have this problem with 1D plot. What is wrong?
hff_Brho_theta_Cm.C (441 KB)

I performed different tests. Problem exist also for 1D spectra. In fact, problem exist only if you draw a histogram like this

But if you type

then ROOT macro file works fine. The problem is I do not put histogram name in the first case.

This “problem” is still present in ROOT 5.34/14. Could you take into account this situation? I mean, one has to check if the canvas contains objects with “empty” name and if so, give them a generic name instead.

Fixed. Thanks.