Change class NodeMap to template class.