When I wrote that code main.name wasn't set correctly and I had to use G.main.name; now it seems to be the other way round :-)
When I wrote that code main.name wasn't set correctly and I had to use G.main.name; now it seems to be the other way round :-)