Move .type onto child elements; add stoc