The returned node id's were exactly the wrong way around; 'to' returned the parents, 'from' returned the children. This fix swaps the tests for determining which to return.