WIP: Fixed test failures etc.

Change-Id: Ib03136960a44532a4b7f46d57a06d91867d092fa