Varaious bug fixes

Change-Id: Ieb391da06fec6f89561e2d702266fb2576fb7894
Signed-off-by: TanelDettenborn <tanel.dettenborn@intel.com>