Thanks for putting up a fix, I just noticed the same problem.
One thing you missed though, is that the first entry can still
apear twice if it's typed in manually (ie. is not in the
autocomplete list). To also fix this, just change the second
condition in this line (case 9 / 188):