When path distance is the same, prefer more specific from_protocol.
Take Mark advice and get rid of magic _SUBCLASS_WEIGHT number.