Checking errors when setting the locale