Fixed to leave original schema mostly unmodified (still adds ids to elements without one)