Fixing unit tests.
Merge branch 'master' into replication