autocomplete widget and a few bug fixes