Fix problem where language detection didn't work for some clients,
and remove some redundancy