Fixed tons of various technical debt.

Change-Id: I4a5a0cd8040cf352a9a4768abbe8bc06e8376978