[MERGE] Sync with trunk and correct upstream mistakes