small bug fix in locale detection