Fix bug associated with redundant nodes.