Bunch of fixes

Change-Id: If84335cae98094743ea5a9e8297b751e3b705e3d