fixed wrong assigned node-type bug ( rel-node) and corrected scope-management