Fixed replacement of aliases in the search query