Fix index search going badly when inputing only spaces.