Balance open-closed tags