Loop fix: make sure that the Item ID is the key of the array so it’s handed over to the function correctly.
Fix for breadcrumbs: make sure that the category with the highest number of parents are returned so that the breadcrumb trail is complete.
Fix PHP warning that may occur on some WooCommerce setups