Fix assortment of issues.

Change-Id: I7f1bf9fe81c1d1fea15df0beb470a3000f09a2d9