Fixed bug in node creation