Fixing various bugs

Change-Id: I5ef0a2c31765461246bd1560a373d998b78bc1af
Signed-off-by: TanelDettenborn <tanel.dettenborn@gmail.com>
Merge "Fixing various bugs"