Fix various issues

Change-Id: Ia0b96cec4a40b7e661692addc723e6879138b102