TREFF: Fix wrongly nested tags