Correctly display nested wrapper elements (see #5976)