fix a bug where sections within sections have the wrong root element