Fixed a bug on language detection