Bring in some things from CM.

Change-Id: Id372837f3573c313363eae238ce32c6765be1b0f