Some fixes, mainly involving language detection.