Improve language detection