better parsing of weird tags