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