more bugfixes for xml+meta auto-repair