Fix tag processing nesting