Fix the visibility flag dictionary for MC template
There was a handful of problems in the MC template:
- a mistyped index causing a "out of index" error
- the lack of an ast parsing for the dictionaries of the visibility flags
- the wrong management of the merging of visibility flags to make a single dict