fixes & tests for autocomplete.