Bug fix on language detection