Fix for UTF-8 validity check in Markov mode.