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

Why are these changes ? Beautification ? Sometimes I need to import Graph in the environment where there is matplotlib installed.