sync with newclient

@lennartcl 
mostly contains changes for autocompletion popup
and fixes two small issues