Fix off-by-one bugs in Damerau-Levenshtein