tools.structure: critical bugfix

There was a confusion between vec and flatten in a) struct_MX  and b)
hierarchically nested structs