Fixes for most unit tests to pass

Signed-off-by: Rossella Sblendido <rossella@midokura.com>
Merge pull request #35 from midokura/ross

Unit tests fixes