[v6r12] Various bug fixes and/or better code in the accounting

I needed it in the past in some cases, this was not done by chance. I do not remember now where the Graphs module was imported to just use non-plot functions. This was in some tools. I will accept the PR for now.