Fixed error in node destructors that caused SegFault