As noted by Jani N. :
Unfortunately, it looks like this triggered a bug when handling .sum graphs.
Regular single graph handling doesnt seem affected.
When a FastCGI process with this change is used to load a .sum graph, it can draw it once
and only once successfully. Any further attempts at redrawing will fail with various
semi-random rrdtool errors, such as "invalid rpn expression in: acdefz4_1,UN,0,acdefz4_1,IF".
This seems to be caused by the $config being modified when .sum graphs are generated.
When the generation is attempted the second time, the graphing fails.
I verified this by modifying the GraphOld.pm to take a clone() of the $config when it is created, and cloning a new instance on every invoke. This is not a good fix though, as it seems to leak memory very quickly.