Fixes double auto completion.

Pressing tab twice would auto complete (the same name) twice.
Auto completion is now disabled when last character in sentence is a
space.