Improve the node checking in the test