Fix error with locales parsing