In lch_similarity, added checking of depth to avoid ZeroDivisionError