commit: Fix a bug with Unicode error sequences and very short input strings.