Fixed bug related to node reference handling