Change change_node_state appropriately.
Fix some more tests.