various bug fixes in autocomplete, scripting interface