Improvements to autocompletion