Merge "Fix the case where restricted mode allowed reasons are ignored"