Merged in upstream.
Fix conflicts from upstream merge.