Fix a bug in node name validation