simplified and fixed get_owned_nodes (thx Gaëtan)