Apply patch
Sync with upstream