Added serializing of nodes.