Fix difference in behaviour between attributes and functions in autocomplete