Fix query when retrieving names of companies