Moved set_locale before set_user.