Fixed small bug in node creation