JS: binary search in tokens fails safely.