Fix the structure of MI tree (output).

Mark the nodes that contain arrays of subnodes (versus list of differente nodes). This is a must in order to properly structure the MI output via the json backend.

(cherry picked from commit 34576f52bcd1351cc7e2f2846e3b37b2e4e35503)