First round of fixes.

Change-Id: I43a8ff64cef41a5ba64da4973b1de1e387b40a5f