Fixed crash when locale is undefined.