Fixing bug in figuring out parents

=D