Tests: Minor fix

Fix a likely off-by-one error which would cause reading off the end of `letters`, and make this a little more efficient