First round of adding more complete unit test coverage. Change-Id: Ic1979c499ca6fcb784892a95954a3527539c4e53