Fix bugs in memory store implementation.
Introduce a ReplicationError.