Sync with upstream and a compilation error fix.