Minor code improvement
Fix string search commands, so they don't crash when command repeat prefix is too big.