Upstream merge and 10.8 modifications.