Replication integration fixes.
Merge pull request #138 from wajam/manu-replication-fixes

Replication integration fixes