Improving autocomplete, bug fixes