Improves locale detection
Minor formatting fix