Sync with #828.