Fixed potential segfaults on autocomplete
Merge branch 'master' into plugins