Added make_node_ptrs unit test. Fixed quite a few bugs.