Replace wrong closing element with correct one.