Ensure order of ancestors

The result order from the find is not guaranteed.