correct detect stop words (fixes #3749)