Script file crashing with histograms

Hello

Has anyone had a problem with their script files crashing, particularly with histograms?

I find my histogram script files crash.  There doesn't seem to be any reason to when they crash.  Sometimes it will output 50+ histograms before crashing, othertimes in crashes after three or four.  Sometimes it happily outputs a particular histogram, other times it doesn't.

I get around the problem by opening the .gsc in notepad, deleting the histograms that have been produced so that the histogram the script originally crashed on is first in the new script and re-run.  Again it will run again, but often fall over shortly.

I don't seem to have this problem with logs, graphs etc.

Has anyone been sucessful in finding a fix?

Thanks