Fix computation of the edit distance

Without initializing the index variable the computation of the edit
distance would be (sometimes) plain out wrong.

Remove code that was badly transliterated from C to Java and simply
makes no sense here.