ModelBuilderVisitor updated.
Bug fixes in removing intermediate nodes.