Fixes for most unit tests to pass

Signed-off-by: Rossella Sblendido <rossella@midokura.com>