Fixed bug with assigning names from saved query

Also fixed bug with the duplicate queries causing the autocomplete to
have duplicate suggestions