Adjust allowed types to make sure the traversal hits all the relevant relationships, and clean up the logic a bit (no real changes other than allowed types)