Fix multisite and middleware in settings