Rebuild HTML. Correct tie detection.