Improve preferred language detection