Upstream merge, lots of changes.