Fixes bad logic that reports expired tokens incorrectly.
Merge remote-tracking branch 'origin/v4.1' into v4.1