Fixes replication bug