Fixing various issues

Change-Id: Id355e0bdd8c2f9519f23de6f86ed9480391aabe2