Fix text node repairing