Fixed problem with duplicated nodes.