Improved subtag detection
Fixed language code support