Synced with upstream.