Fix SentenceDetector bugs