fixed segfaults during node cloning