@njx good catch! 

It looks like I had a copy and paste error from what I had written originally (which worked) and then the off-by-one.  Strangely enough I use the Getting started Russian Sample to validate and it worked but then, when I fixed the off-by one and the break out of the loop on a match, it stopped working.  My guess is that the algorithm went wildly out of control since we were changing the data length and it just magically worked in that case.