Fix computing start and end indices of sentences