Improve autocomplete and tests