Fixed language detection and redirects