fix some tag handling