Fix assortment of issues.

Change-Id: I8dd5d216bb6ab13d15176a7c5c826ab58bfd6e01