Fixes a crash with the auto-complete view, as well as preventing spaces to be used as the first character in the search bar