Fixed small bug in language detection